#ifndef GAMEMANAGER_H
#define GAMEMANAGER_H

#include <QObject>
#include "units/game.h"
#include "units/player.h"
#include "main.h"

class GameManager : public QObject
{
    Q_OBJECT
public:
    explicit GameManager(QObject *parent = 0);
    static Game* NewGame(quint64 gid,quint32 pid, quint8 gmode,quint8 maxplayers,quint8 maxlvl,
                        quint8 minlvl,QString name, QString desc);
    static void JoinToGame(quint64 gid, quint32 pid);
    static void LeaveGame(quint32 pid);
    static QByteArray GetPktList();
    static Game* GetGame(quint64 guid);
    static Game* GetPlayerGame(quint32 pid);
    static quint32 GameCount(){ return LGames.count(); }
    static quint32 _PlayersInGame;
};

#endif // GAMEMANAGER_H
